//
//  PhotoLibViewController.h
//  XPhoto
//
//  Created by baboy on 2019/6/3.
//  Copyright © 2019 baboy. All rights reserved.
//

#import "BKViewController.h"
#import "PhotoEditViewController.h"
#import "PhotoAsset.h"

NS_ASSUME_NONNULL_BEGIN
@protocol PhotoLibViewDelegate;

@interface PhotoLibViewController : BKViewController<UICollectionViewDelegate, UICollectionViewDataSource,PhotoEditDelegate>
@property(nonatomic, strong) IBOutlet UICollectionView *collectionView;
@property(nonatomic, assign) id<PhotoLibViewDelegate> delegate;
@property(nonatomic, assign) NSInteger maxSelectedCount;
@property(nonatomic, assign) NSInteger maxVideoCount;
@property(nonatomic, assign) NSInteger maxPhotoCount;
@property(nonatomic, strong, readonly) NSArray<PHAsset*> *selectedAssets;
/**
 * 是否只能选择一个类型，默认true
 */
@property(nonatomic, assign) BOOL selectionOneType;
@property(nonatomic, assign) BOOL edit;

- (void)selectedAssetsChanged;
- (void)editWithSelectedAssets;
@end

@protocol PhotoLibViewDelegate <NSObject>

@required
/**
 * 完成选择操作
 */
- (void)photoLibViewController:(PhotoLibViewController *)vc didSelectPhotos:(NSArray<PhotoAsset *> *)photos;

@optional
- (void)photoLibViewController:(PhotoLibViewController *)vc didSelectAsset:(PHAsset*)asset;
- (void)photoLibViewController:(PhotoLibViewController *)vc didDeselectAsset:(PHAsset*)asset;
- (BOOL)photoLibViewController:(PhotoLibViewController *)vc shouldSelectAsset:(PHAsset*)asset;
@end
NS_ASSUME_NONNULL_END
